<template>
  <div class="app-container">
    <el-form ref="form" :model="form" label-width="120px">
      <el-form-item label="会议名称" width = "200px">
        <el-input v-model="form.name" />
      </el-form-item>
      <el-form-item label="开始时间">
        <el-date-picker
          v-model="form.time"
          type="datetime"
          placeholder="选择日期时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="会议发起人">
        <el-input v-model="form.leader" />
      </el-form-item>
      <el-form-item label="开会场地">
        <el-input v-model="form.subject" />
      </el-form-item>
      <el-form-item label="开会时长">
        <el-input v-model="form.period" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">确定</el-button>
        <el-button @click="onCancel">取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>

import { addMeeting } from '@/api/meeting-sys'

export default {
  data() {
    return {
      form: {
        name: '',
        time: '',
        leader: '',
        subject: '',
        region: '',
        period: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      }
    }
  },
  methods: {
    onSubmit() {
      this.fetchData(this.form)
    },
    onCancel() {
      this.$message({
        message: 'cancel!',
        type: 'warning'
      })
    },
    fetchData(param) {
      addMeeting(param).then(res => {
        // success callback
        this.$message({
          message: res.errorMsg
        })
      })
    }
  }
}
</script>

<style scoped>
.line{
  text-align: center;
}
</style>

